<html>
  <head>
    <title>Test</title>
    <script src="correlation.js" type="text/javascript"></script>
  </head>
  <body>

  <script type="text/javascript">
    var m = [
      [5,  50],
      [20, 60],
      [40, 60],
      [80, 50],
      [100, 40]
    ];

    m.getValue = function(x,y) {
      return this[x][y];
    }

    m.getNumberOfRows = function(x,y) {
      return this.length;
    }

    document.write("<br>\n");
    document.write("Number of Samples: " + m.length);
    document.write("<br>\n");
    document.write("Corr: " + Correlate(m, 0, 1));
    document.write("<br>\n");

    document.write("CorrTxt(0.9): " + GetCorrelateText(0.9));
    document.write("<br>\n");
    document.write("CorrTxt(0.7): " + GetCorrelateText(0.7));
    document.write("<br>\n");
    document.write("CorrTxt(0.5): " + GetCorrelateText(0.5));
    document.write("<br>\n");
    document.write("CorrTxt(0.3): " + GetCorrelateText(0.3));
    document.write("<br>\n");

    document.write("CorrTxt(0): " + GetCorrelateText(0));
    document.write("<br>\n");

    document.write("CorrTxt(-0.3): " + GetCorrelateText(-0.3));
    document.write("<br>\n");
    document.write("CorrTxt(-0.5): " + GetCorrelateText(-0.5));
    document.write("<br>\n");
    document.write("CorrTxt(-0.7): " + GetCorrelateText(-0.7));
    document.write("<br>\n");
    document.write("CorrTxt(-0.9): " + GetCorrelateText(-0.9));
    document.write("<br>\n");

  </script>


  </body>
</html>

